package com.caozhi.mspeoject.nb_search.repository;

import com.woniuxy.boot.common.bean.EsFeedback;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FeedbackSearchRepository extends ElasticsearchRepository<EsFeedback, Long> {
//    @Query("{\"bool\": {\"must\": [{\"term\": {\"name\": ?0}}, {\"term\": {\"phone\": ?1}}], \"minimum_should_match\": 1}}")
//    List<EsFeedback> findByNameOrPhone(String name, String phone);
    List<EsFeedback> findByName(String name);
    List<EsFeedback> findByPhone(String phone);
    List<EsFeedback> findAll();
    void  deleteAll();
}
